UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+peHOyrdlGRsZnW/SXwyqruv6ofEtjFnt5Yl6ojzwtE='
WHERE
key_id = 'd254888a10fbca11f3ae73412140f945474296280d647b65c9c67752ce709626'
AND (
token = '+peHOyrdlGRsZnW/SXwyqruv6ofEtjFnt5Yl6ojzwtE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)