UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '93Y6TVz1krQQIy31bJzEAJsgqJsepugmjI/SH1G/VZ8=' 
WHERE 
  key_id = 'a7ac95049899b2f6607b957aa3b8234d9ad528454056deb07e61fd6f30963d1a' 
  AND (
    token = '93Y6TVz1krQQIy31bJzEAJsgqJsepugmjI/SH1G/VZ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027