UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WYt0Dt+F2s+0/8kzGes7kFP0DvSl5qjEmM6McIL3lG4=' 
WHERE 
  key_id = '53640532b54bfa7d0043aeb3a9508752cd293de5ba82c96aaf8e18ea4e067e43' 
  AND (
    token = 'WYt0Dt+F2s+0/8kzGes7kFP0DvSl5qjEmM6McIL3lG4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032