UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/AswCF5ERx53cYiEa6QIulB93LpkLOxWx7w2ZkCtlEQ=' 
WHERE 
  key_id = '00ff4692e74a0076eedf30df11cd416122ba98c2c1ca23b144913c7c7be67dd4' 
  AND (
    token = '/AswCF5ERx53cYiEa6QIulB93LpkLOxWx7w2ZkCtlEQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022