UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MBYo1+/4r4WCHukehkXPdAEWhUzwpTn6Koecu33afMU=' 
WHERE 
  key_id = '78b8a4c43fc749cf3ba73652b56e63f28c3c9bb2cca2bffb8d073b0a6537c74d' 
  AND (
    token = 'MBYo1+/4r4WCHukehkXPdAEWhUzwpTn6Koecu33afMU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039