UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D+7/oflayr7Yle0pboMGGY4DbfJ4f97HvjNKJdLr55A='
WHERE
key_id = 'e1d957fc897593de3caa7deb5256704ad6b9d5798f530b3ca8b8aa762dcb5337'
AND (
token = 'D+7/oflayr7Yle0pboMGGY4DbfJ4f97HvjNKJdLr55A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)