UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iFN2TwKb4+BVO1bHTJwbQ5qtA9S/0Ms+PbVfKS9iSEg='
WHERE
key_id = '68da932a1d0c0eac44546b130d8afaa830651e16c1b40b606aaf111e62c9d91c'
AND (
token = 'iFN2TwKb4+BVO1bHTJwbQ5qtA9S/0Ms+PbVfKS9iSEg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)