UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EfkENIANz7/mKsJi3cigGBEkplDID330amIK9uIKxEY='
WHERE
key_id = 'ce90004130b7ea6a7c856f2f310063046f4ce07b4b0bb1952bf8a39788c9a34e'
AND (
token = 'EfkENIANz7/mKsJi3cigGBEkplDID330amIK9uIKxEY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)