UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M8qLJcaFjkuJMyibqehEPwRibVNH5VZdQptC0u8BA28=' 
WHERE 
  key_id = '92509b277f213549321ae69cb63b63c76f14136f66fcc84f7c69358e7e300e94' 
  AND (
    token = 'M8qLJcaFjkuJMyibqehEPwRibVNH5VZdQptC0u8BA28=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035