UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P7AFrcFvhG8xy5WJfZewljzuVk4AYYGW/LpTlpDrdyU=' 
WHERE 
  key_id = 'd99f3c6418273ef2a934c890bb7f666bacb6cd68d36ed2c6c299d7fe1cbd1a06' 
  AND (
    token = 'P7AFrcFvhG8xy5WJfZewljzuVk4AYYGW/LpTlpDrdyU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017