UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9ok21E7J4p+Dd6oGCsFbXdMaiG2YCpcWaI0W4b34GcA=' 
WHERE 
  key_id = '4960d9ad504989254d62635d7c7abd7ed7f2a761eacee55cd7a1f0c78f02ab63' 
  AND (
    token = '9ok21E7J4p+Dd6oGCsFbXdMaiG2YCpcWaI0W4b34GcA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033