UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't4nqSO4qt7dU4BR1srEUlQ4hXLjd+J7sRl6vzOjbKd4=' 
WHERE 
  key_id = '41b225695f997f0fd3dd7720e1d40a787874772a7d17462eeaa8ea19f4234363' 
  AND (
    token = 't4nqSO4qt7dU4BR1srEUlQ4hXLjd+J7sRl6vzOjbKd4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032