UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u0Vs3OfB7xVY6BjGbZq5+NX/V+tRFr0ZQq0XHMmlSFY=' 
WHERE 
  key_id = '71c72ee96d9893626fb57237c216c519e0eeb0257589e11c4800146f2f82a81e' 
  AND (
    token = 'u0Vs3OfB7xVY6BjGbZq5+NX/V+tRFr0ZQq0XHMmlSFY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049