UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8/YTXLsmgmju+ary4RBr1QZtWWxUNi5ehoWbOTUhOz0=' 
WHERE 
  key_id = 'adb11746e7b979279e940ae527af41ee48087fa24abfcae8520ee7f24a280d35' 
  AND (
    token = '8/YTXLsmgmju+ary4RBr1QZtWWxUNi5ehoWbOTUhOz0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039