UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JMyhS5i96mT5SLg099ka7UfoDVWNlCtIhuztezesBFg='
WHERE
key_id = 'd6edca1cd88ac32c788afe7ec3b7a614f839faa1c5a3cf0202efc61cfc6fa534'
AND (
token = 'JMyhS5i96mT5SLg099ka7UfoDVWNlCtIhuztezesBFg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)