UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dYcxTn8sQGDOnyW/cXKcV2WkkCJBJI7Pm+7TXHrxloU=' 
WHERE 
  key_id = '283e13e07c5e4dae5532b1ce23411cbad5beb0045c97ff43a0f7a3cbaf33c892' 
  AND (
    token = 'dYcxTn8sQGDOnyW/cXKcV2WkkCJBJI7Pm+7TXHrxloU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057