UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6EOVJd85dE/jXGARQjtT0txX3UMbVTz4gsWkjwlrqLE=' 
WHERE 
  key_id = 'c95e33ed99ab04f42b2a5de5cbfd68e55a90f6785d06d16018658f13e64c44b5' 
  AND (
    token = '6EOVJd85dE/jXGARQjtT0txX3UMbVTz4gsWkjwlrqLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017