UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7H5JJyyBf+6Dr2HG964DTr71xncy6hhLaCvDX44dYLU='
WHERE
key_id = 'c4335a0187db38081a8c21a9f4dec78cbdb9b91f3c2d22f66ccc82bb7fb205dc'
AND (
token = '7H5JJyyBf+6Dr2HG964DTr71xncy6hhLaCvDX44dYLU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)