UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w23/drGu8djEd3aW+E1ASO//XiLJig+sZWDcjxTWPFc=' 
WHERE 
  key_id = '9dede4270e45284304012e76884bcb1ef0daad151730a9cd9606174823effbb6' 
  AND (
    token = 'w23/drGu8djEd3aW+E1ASO//XiLJig+sZWDcjxTWPFc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028