UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SYoZk5oU34Iql8RFMw8tYr0NosgnkNpKhF99bC7rDRU=' 
WHERE 
  key_id = '661523f82f300cf1a26b03ed368fca9911d1e9580b84c01e714c72ff7ccdc921' 
  AND (
    token = 'SYoZk5oU34Iql8RFMw8tYr0NosgnkNpKhF99bC7rDRU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028