UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MR5Pp+T/lm3siOl4+bRH3zB8GowGmmi1CNwDyLrankM=' 
WHERE 
  key_id = '0ee8a23d42be71303144ce180520772b7e27db45459b661742438991aaba96f8' 
  AND (
    token = 'MR5Pp+T/lm3siOl4+bRH3zB8GowGmmi1CNwDyLrankM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044