UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qfJdfmNf5hZcNZgUukqZsI1fUQwgVfj8ozvUsO2oqXQ='
WHERE
key_id = '3cd8feb8341597f93767fbaa217240a1a5aab37893559a546632bcbed334afd6'
AND (
token = 'qfJdfmNf5hZcNZgUukqZsI1fUQwgVfj8ozvUsO2oqXQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)