UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '13MA7l+hX7BNqyI+4fSXsT/JxMiYJcAubTJfk5TK/LI='
WHERE
key_id = '8809519893447aee1f62a3e7de2ae8a74bddd49d586f639822ab398250502b87'
AND (
token = '13MA7l+hX7BNqyI+4fSXsT/JxMiYJcAubTJfk5TK/LI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)