UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AtHjKiHvU6IktSIHWjlDKVYOdZuxcpkh8mg0C3350fw='
WHERE
key_id = '9738425066c9fc1baa1798aefe51832bbae4634983c606a9b62f285bea053ce8'
AND (
token = 'AtHjKiHvU6IktSIHWjlDKVYOdZuxcpkh8mg0C3350fw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)