UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dLbCz739DymawyHhBqV95LtyIM5orNJ9KedkNa5+9cI=' 
WHERE 
  key_id = 'ca014ec92a24154c40c86db4943fb53e715216f8dc0492e02be8bbb74167ab1a' 
  AND (
    token = 'dLbCz739DymawyHhBqV95LtyIM5orNJ9KedkNa5+9cI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020