UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p6PvZNnmuJRV26P0LlqOJvBfHx7i89HTAjP1T/XhkdU='
WHERE
key_id = '16cfcddc5eddf24f103a1c61c83226e0c1e7637f5e1fe3f2b391bd30e0b3b90e'
AND (
token = 'p6PvZNnmuJRV26P0LlqOJvBfHx7i89HTAjP1T/XhkdU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)