UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IAJCz9ieL32htu8V7ynHhkvB7iHoVBTtdoqgFTlqVp0='
WHERE
key_id = '22095520e05711b1b3e88435991a2055e170c28bb1112f915d50a6fcc6b4be43'
AND (
token = 'IAJCz9ieL32htu8V7ynHhkvB7iHoVBTtdoqgFTlqVp0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)