UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6CE8wY4MZQEi6lZDTFFNfQKjTfecUnfX09PbcGuYjx0='
WHERE
key_id = '25cd79ce14a6a7ec5eacf9cf08929f8a668e1ee97369743639e16c0bcb7db940'
AND (
token = '6CE8wY4MZQEi6lZDTFFNfQKjTfecUnfX09PbcGuYjx0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)