UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+/RMRNxILxdj+159+CmJI1q2Kn4EkZx+hf/wsQ2+Hok=' 
WHERE 
  key_id = '03042c422e00e3081cc3cc83cd98ef4bde2576a4662eaa32527bb602809cc2d0' 
  AND (
    token = '+/RMRNxILxdj+159+CmJI1q2Kn4EkZx+hf/wsQ2+Hok=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039