UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VCR6XYlbbBNs+/uhrUGCeMnI/zMD7BC3938buxi0eGI='
WHERE
key_id = '52c6a7b280ab1fe1b87aa43481f281e49a5cb1be0b44d4d28035e97a3b87d7a3'
AND (
token = 'VCR6XYlbbBNs+/uhrUGCeMnI/zMD7BC3938buxi0eGI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)