UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lwZz/rGfGxk5CyRjDSfFdiP/wTF1m+qNE3jgzJ2FToM='
WHERE
key_id = '5ebd8820b7fba5ac5b8c34826241464cd06a5df9c0409614d274f98fb71eb3c9'
AND (
token = 'lwZz/rGfGxk5CyRjDSfFdiP/wTF1m+qNE3jgzJ2FToM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)