UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u3lsoUnW4GKF6qn3PyNhE7efWGTszZJ8CzIKdp37be8='
WHERE
key_id = '8a2962e05c734779bd29808c66a14cb185241c523836036db2041f9a18469327'
AND (
token = 'u3lsoUnW4GKF6qn3PyNhE7efWGTszZJ8CzIKdp37be8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)