UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mV0WROjX/vHgDbRNOvGMtO4lOTLSIXcyYMfvlQpFTsA='
WHERE
key_id = '1a5790e54a4c30604f3fa6633f2bec0f6ad3f3fb1b78c66379e3c6ea3026be7d'
AND (
token = 'mV0WROjX/vHgDbRNOvGMtO4lOTLSIXcyYMfvlQpFTsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)