UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qEY1E2ZzuE930XLQGBiofyeZG16vsPRCYHqtiqZ5nXo=' 
WHERE 
  key_id = '6867e53e81c997bab2c7c61b8604e0d8cb46e37f77711712bde84d97a320a7a7' 
  AND (
    token = 'qEY1E2ZzuE930XLQGBiofyeZG16vsPRCYHqtiqZ5nXo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033