UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hkVfMQcdHVQYtedwnWFmhO8pKykC537elX/3pXg85BE='
WHERE
key_id = '0d552009ec5cac21f98aa0cffded7bd7b25c16ed717f9138559fe2848e119a6d'
AND (
token = 'hkVfMQcdHVQYtedwnWFmhO8pKykC537elX/3pXg85BE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)