UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KVbaap38RD9tLqWP7y732XgKfzI8kMMSQkwve5ByJoA=' 
WHERE 
  key_id = '0c2f76942bcb75494b46a4d6db0cb328c8ba9a6c4857d7d7c172f70edd498bb5' 
  AND (
    token = 'KVbaap38RD9tLqWP7y732XgKfzI8kMMSQkwve5ByJoA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013