UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'spDOd99pJ+0jL6/cauKo6cPENt5ALklFg6mF9QDMr9c=' 
WHERE 
  key_id = '7acb9cfb7d2f1512a58b94640370994f9ba1be98770d92c2802bcb47e07539be' 
  AND (
    token = 'spDOd99pJ+0jL6/cauKo6cPENt5ALklFg6mF9QDMr9c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024