UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rPTqTkaVXUS1dmqZZKroC9pYA1R+Lt/cx+TFwI/WbBY='
WHERE
key_id = '93fee79a160584ba3571e2c84e8a46db05e25154eba1ac470c73250c4dbf6a90'
AND (
token = 'rPTqTkaVXUS1dmqZZKroC9pYA1R+Lt/cx+TFwI/WbBY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)