UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oW5GSyJm8KdVS+jpAZpKxSO6UYy3RS8Z4qoFSg/3ZsM='
WHERE
key_id = '53a745a4c1d22221c2b81be85dfe89a64a305fbfe2a4d0edb60f5eaf8698ed22'
AND (
token = 'oW5GSyJm8KdVS+jpAZpKxSO6UYy3RS8Z4qoFSg/3ZsM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)