UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M/J4Lpk4F4gKP4vUGxYE3xzh3zBalFPToiQFtrEtayI=' 
WHERE 
  key_id = '4b12e6aeed9775f638d48e092a0552554234c8881ce99fb3f7b33e6efe66724d' 
  AND (
    token = 'M/J4Lpk4F4gKP4vUGxYE3xzh3zBalFPToiQFtrEtayI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025