UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '37x9Dj6X/pj4aKj+5hTszt0rSw3HygkB+gEKY0oNw28='
WHERE
key_id = '78f557e5970770ecf0885e74f7cb4ceadb01afb7cf08febeb85c38c6e4986a09'
AND (
token = '37x9Dj6X/pj4aKj+5hTszt0rSw3HygkB+gEKY0oNw28='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)