UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'phfS75UgPw/X7FBYP/0EV7X57BXP9Mh25BlmpX0Frsk='
WHERE
key_id = '55430bfff20548a3a3a126bc91d30062c6ab8e70b6262d254f911b98c291e9d7'
AND (
token = 'phfS75UgPw/X7FBYP/0EV7X57BXP9Mh25BlmpX0Frsk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)